package com.linzm.behavioraltype.command02;

import com.linzm.behavioraltype.command02.order.BuyStock;
import com.linzm.behavioraltype.command02.order.SellStock;

/**
 * @Author zimingl
 * @Date 2023/4/16 2:54
 * @Description: CommandPatternDemo
 */
public class CommandPatternDemo {
    public static void main(String[] args) {
        Stock abcStock = new Stock();

        BuyStock buyStockOrder = new BuyStock(abcStock);
        SellStock sellStockOrder = new SellStock(abcStock);

        Broker broker = new Broker();
        broker.takeOrder(buyStockOrder);
        broker.takeOrder(sellStockOrder);

        broker.placeOrders();
    }
}
